import requests


class EmpManage:
    @classmethod
    def emp_add(cls, headers, req_json):
        response = requests.post("http://ihrm2-test.itheima.net/api/sys/user", headers=headers, json=req_json)
        return response

    @classmethod
    def emp_modify(cls, headers, emp_id, req_json):
        response = requests.put(f"http://ihrm2-test.itheima.net/api/sys/user/{emp_id}", headers=headers, json=req_json)
        return response

    @classmethod
    def emp_delete(cls, headers, emp_id):
        response = requests.delete(f"http://ihrm2-test.itheima.net/api/sys/user/{emp_id}", headers=headers)
        return response

    @classmethod
    def emp_query(cls, headers, emp_id):
        response = requests.get(f"http://ihrm2-test.itheima.net/api/sys/user/{emp_id}", headers=headers)
        return response


if __name__ == '__main__':
    res = EmpManage.emp_add({
      "username": "万天",
      "mobile": "18400000001",
      "workNumber": "0001"
    }).json()
    print(res)